﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageUser.aspx.cs" Inherits="Ebiz.ManageUser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">
        var btnSave = "<%= btnSave.ClientID %>";
        var cbRole = "<%= cbRole.ClientID %>";
    </script>
    <script src="js/users.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <h3>Users Management</h3>
    <form id="Form1" runat="server">
        <div id="divUsersBox" style="margin:5px 50px;">
            <div id="userInfo" style="margin-bottom:15px;display:none;">
                <table id="tblUserInfo" style="margin-left:60px; font-size:12px;text-align:left;">
                    <tr>
                        <td style="height:24px;">Username</td><td>:</td>
                        <td colspan="2">
                            <span class="spnInfo"></span>
                            <asp:TextBox ID="txtUserName" runat="server" Width="210px" CssClass="hideCtrl" ></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ErrorMessage="Username is required" ControlToValidate="txtUserName" 
                                SetFocusOnError="True" ValidationGroup="FRMCTRL">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="height:24px;">ID Network</td><td>:</td>
                        <td colspan="2">
                            <span class="spnInfo"></span>
                            <asp:TextBox ID="txtIDNet" runat="server" Width="210px" CssClass="txtInfo" ></asp:TextBox>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ErrorMessage="ID Network is required" ControlToValidate="txtIDNet" 
                                SetFocusOnError="True" ValidationGroup="FRMCTRL">*</asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <td style="height:24px;">Full Name</td><td>:</td>
                        <td colspan="2">
                            <span class="spnInfo"></span>
                            <asp:TextBox ID="txtFName" runat="server" CssClass="txtInfo" Width="210px" ></asp:TextBox>
                        </td>
                        <td><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ErrorMessage="Full name is required" ControlToValidate="txtFName" 
                                SetFocusOnError="True" ValidationGroup="FRMCTRL">*</asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <td style="height:24px;">Email Address</td><td>:</td>
                        <td colspan="2">
                            <span class="spnInfo"></span>
                            <asp:TextBox ID="txtEmail" runat="server" CssClass="txtInfo" Width="210px" ></asp:TextBox>
                        </td>
                        <td><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ErrorMessage="Email Address is required" ControlToValidate="txtEmail" 
                                SetFocusOnError="True" ValidationGroup="FRMCTRL">*</asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ErrorMessage="Please enter correct email address" SetFocusOnError="True" 
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                                ValidationGroup="FRMCTRL" ControlToValidate="txtEmail">*</asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="height:24px;">Role</td><td>:</td>
                        <td colspan="2">
                            <span class="spnInfo"></span>
                            <asp:DropDownList ID="cbRole" runat="server" CssClass="txtInfo" Width="210px">
                            </asp:DropDownList>
                        </td>
                        <td><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                ErrorMessage="Role is required" ControlToValidate="cbRole" 
                                SetFocusOnError="True" ValidationGroup="FRMCTRL">*</asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <td style="height:24px;">Approval Authorized</td><td>:</td>
                        <td colspan="2">
                            <span class="spnInfo"></span>
                            <asp:DropDownList ID="cbApvAuth" runat="server" CssClass="txtInfo">
                                <asp:ListItem Value="N" Text="No"></asp:ListItem>
                                <asp:ListItem Value="Y" Text="Yes"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr><td colspan="5">&nbsp;</td></tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                        <td colspan="3">
                            <input type="hidden" name="txtMode" id="txtMode" class="txtMode" value="" runat="server" />
                            <input type="button" id="btnCancel" class="btnSmall" value="Cancel" style="width:81px;" />
                            <input type="button" id="btnEdit" class="btnSmall" value="Edit" style="width:81px;" />
                            <input type="button" id="btnDelete" class="btnSmall" value="Delete" style="width:81px;" />
                            <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btnUpdate btnSmall hideCtrl" 
                                Width="81px" ValidationGroup="FRMCTRL" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5">
                            <span></span>
                            <asp:ValidationSummary ID="validSum" runat="server" ValidationGroup="FRMCTRL" />
                        </td>
                    </tr>
                    <tr><td colspan="5">&nbsp;</td></tr>
                </table>
            </div>
            <div id="addBox" style="margin:5px 0;text-align:left;">
                <div id="btnAdd" class="btnSmall">Add New</div>
            </div>
            <table id="tblUserList" class="tblstyle" style="width:100%;">
                <thead>
                    <tr>
                        <th style="table-layout:fixed; width:120px;">Username</th>
                        <th style="table-layout:fixed; width:120px;">ID Network</th>
                        <th>Full Name</th>
                        <th style="table-layout:fixed; width:45px;">Role</th>
                        <th style="table-layout:fixed; width:30px;">Option</th>
                    </tr>
                </thead>
                <tbody>
                    <%= UserList %>
                </tbody>
            </table>
        </div>
    </form>
</asp:Content>
